<!DOCTYPE html>
<html>
<head>
    <title>酒店列表</title>
		<#include "/header.html">
		<script src="${request.contextPath}/statics/libs/ajaxupload.js"></script>
		<script src="${request.contextPath}/statics/libs/qrcode.min.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
        	<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.name" @keyup.enter="query" placeholder="请输入酒店名称">
			</div>
			<a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("dev:hotel:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("dev:hotel:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("dev:hotel:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
														                   
					<div class="form-group">
                        <div class="col-sm-2 control-label">所属城市</div>
                        <div class="col-sm-10">
                            <!-- <input type="text" class="form-control" v-model="hotel.cityId" placeholder="城市ID"/> -->
                            <select name="interest" lay-filter="aihao" class="form-control"  v-model="hotel.cityId">
                            	 <option value="">---请选择---</option>
							     <option v-for="city in citylist" :value="city.id"  :lable="city.name">
							         {{city.name}}
							     </option>
						        <!-- <option value="">---请选择---</option>
						        <option value="0">写作</option>
						        <option value="1" selected="">阅读</option>
						        <option value="2">游戏</option>
						        <option value="3">音乐</option>
						        <option value="4">旅行</option> -->
					      	</select>
                        </div>
                    </div>
                    
					<div class="form-group">
                        <div class="col-sm-2 control-label">酒店名称</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="hotel.name" placeholder="酒店名称"/>
                        </div>
                    </div>
                    
                    <div class="form-group">
						<div class="col-sm-2 control-label">用户名</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="hotel.username" placeholder="登录账号" v-bind:disabled="hotel.id"/>
						</div>
					</div>
					
					<div class="form-group">
						<div class="col-sm-2 control-label">密码</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="hotel.password" placeholder="密码"/>
						</div>
					</div>
                    
                   
                    
                    <div class="form-group">
                        <div class="col-sm-2 control-label">封面图</div>
                        <div class="col-sm-10">
                          <!--   <input type="text" class="form-control" v-model="hotel.pic" placeholder="封面图"/> -->
                            <button type="button" class="layui-btn" id="upload"><i class="layui-icon"></i>上传封面图</button>
                			<span class="layui-inline layui-upload-choose">
                				尺寸:550*412
                			</span>
                			<span class="layui-inline layui-upload-choose" style="padding: 10px 0px;">
                				<img class="layui-upload-img" :src="'${request.contextPath}/userfiles/hotel/'+hotel.pic"  style="height: 200px;width: 100%;">
                			</span>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <div class="col-sm-2 control-label">经纬度</div>
                        <div class="col-sm-10">
                           <!--  <iframe src="${request.contextPath}/statics/plugins/baidumap/searchmap.html" style="width: 1200px;height: 600px"></iframe> -->
                        	<iframe src="${request.contextPath}/statics/plugins/baidumap/searchmap.html" height="550px;" width="1000px;"></iframe>
                        	<div style="display: flex;align-items: center;margin-top:10px">
                        	<input type="text" class="form-control" v-model="hotel.lng" placeholder="经度" style="width: 150px;margin-right:10px"/>
                        	 —
                        	<input type="text" class="form-control" v-model="hotel.lat" placeholder="纬度" style="width: 150px;margin-left:10px"/>
                        	</div>
                        	
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">手机号</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="hotel.mobile" placeholder="手机号"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">地址</div>
                        <div class="col-sm-10">
                            <textarea placeholder="地址" class="layui-textarea" v-model="hotel.address"></textarea>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <div class="col-sm-2 control-label">描述</div>
                        <div class="col-sm-10">
                             <textarea placeholder="描述" class="layui-textarea" v-model="hotel.intro"></textarea>
                        </div>
                    </div>
                    
					
                    
					 <div class="form-group">
                        <div class="col-sm-2 control-label">最低消费(元)</div>
                        <div class="col-sm-10">
                             <input type="number" class="form-control" v-model="hotel.money" placeholder="价格"/>
                        </div>
                    </div>
                    
					<div class="form-group">
                        <div class="col-sm-2 control-label">核销密码</div>
                        <div class="col-sm-10">
                        	<input type="text" class="form-control" v-model="hotel.code" placeholder="早餐券核销密码" />
                        </div>
                    </div>
                    
					<div class="form-group">
                        <div class="col-sm-2 control-label">是否隐藏</div>
                        <div class="col-sm-10">
                        	 <label class="radio-inline">
                        	 	<input type="radio" name="isShow" value="0" v-model="hotel.isShow"/> 显示
							</label>
							<label class="radio-inline">
								<input type="radio" name="isShow" value="1" v-model="hotel.isShow"/> 隐藏
							</label> 
							 
                        </div>
                    </div>
                    
					<div class="form-group">
                        <div class="col-sm-2 control-label">排序</div>
                        <div class="col-sm-10">
                            <input type="number" class="form-control" v-model="hotel.sort" placeholder="值越大越靠前"/>
                        </div>
                    </div>
											
											   
			<div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/dev/hotel.js?_${.now?long}"></script>

</body>
</html>